import ThemedImage from "@theme/ThemedImage";

# Account Setup

This document shows you how to create an account on the Touca server to submit
new test results and view the test results submitted by your team. We are going
to use the managed cloud instance of Touca deployed to
[app.touca.io](https://app.touca.io). If you are self-hosting Touca, the
instructions are exactly the same.

## Create a User Account

<ThemedImage
  alt="Touca server signup page"
  sources={{
    light:
      "https://touca.io/docs/external/assets/touca-page-account-signup.light.png",
    dark: "https://touca.io/docs/external/assets/touca-page-account-signup.dark.png"
  }}
/>

You only need an email address to create an account on Touca. We will send you
an email with an activation link that lets you set your fullname, username, and
password to complete the account setup process.

<ThemedImage
  alt="Touca onboarding page"
  sources={{
    light:
      "https://touca.io/docs/external/assets/touca-page-account-onboard.light.png",
    dark: "https://touca.io/docs/external/assets/touca-page-account-onboard.dark.png"
  }}
/>

For convenience, Touca Cloud allows signing up using your Google account. We
will reuse the name and email address associated with your Google account,
simplifying the overall onboarding process.

## Create a New Team

You will notice that Touca has automatically created a Team for you and
populated them with sample test results that will help you explore Touca in
action. If you are self-hosting Touca, your platform administrator may have
disabled this feature.

We encourage you to explore the sample test results in the "Tutorial" team, but
you can create your own team, as well. Each user account on Touca can be a
member or the owner of multiple teams. To create a team, simply click on the
"New Team" button on the top right corner of the screen.

<ThemedImage
  alt="Important buttons on Touca are always on the top-right corner."
  sources={{
    light:
      "https://touca.io/docs/external/assets/touca-page-team-create-team.light.png",
    dark: "https://touca.io/docs/external/assets/touca-page-team-create-team.dark.png"
  }}
/>

Creating a team requires choosing a "slug" and a "name". We recommend that you
choose descriptive values for both. You will share them with those you invite to
your team. Other users who want to join your team would need to know your team
slug to send requests.

- A team slug can be any string no less than 3 and no more than 32 characters in
  length. It can mix numeric digits and ASCII letters with hyphens in between.
  `acme-proj-2` is a valid slug.
- A team name can be any string up to 32 characters in length.

## Find your API Key

You will need an API Key to submit test results to your team. You can use the
Submit button right from the team page to obtain your API Key. This section also
shows your API URL which is needed when self-hosting the Touca server.

Alternatively, you can use Touca CLI command
[`touca login`](../../cli/test#setting-api-credentials) to automatically set
your API credentials into your configuration profile.

<ThemedImage
  alt="Using submit button to obtain API Key and API URL"
  sources={{
    light:
      "https://touca.io/docs/external/assets/touca-submit-button.light.png",
    dark: "https://touca.io/docs/external/assets/touca-submit-button.dark.png"
  }}
/>

You should always treat your API Key as a secret and take measures to avoid
exposing it to other people. Just like passwords and other sensitive
information, we strongly recommend regenerating your API Keys from time to time.
You can add, refresh, or remove API Keys from the "API Keys" tab in your
settings page.

<ThemedImage
  alt="API Keys tab help you regenerate your API Keys"
  sources={{
    light:
      "https://touca.io/docs/external/assets/touca-settings-api-keys.light.png",
    dark: "https://touca.io/docs/external/assets/touca-settings-api-keys.dark.png"
  }}
/>

## Join an Existing Team

If your team members have already created an team, you can ask to join them by
clicking the "Join an Existing Team" button and entering the slug for the team
you want to join. This will send a Join Request that the team admins or the team
owner can approve or decline.

<ThemedImage
  alt="You will need approval from a Team Admin to join that team."
  sources={{
    light:
      "https://touca.io/docs/external/assets/touca-page-team-join-team.light.png",
    dark: "https://touca.io/docs/external/assets/touca-page-team-join-team.dark.png"
  }}
/>

## Create a Suite

You can create any number of suites within a team. Each suite can correspond to
a workflow in your product and can host test results submitted for different
versions of that workflow. Similar to creating a team, creating a suite requires
a slug and a name. Suites created within a team can be accessed by all members
of that team.

<ThemedImage
  alt="You can always change the name and the slug of your suite from the Settings tab."
  sources={{
    light:
      "https://touca.io/docs/external/assets/touca-page-team-create-suite.light.png",
    dark: "https://touca.io/docs/external/assets/touca-page-team-create-suite.dark.png"
  }}
/>

Upon creation of a new suite, the Touca Server provides you with an API Key and
an API URL. You can use this information to submit your test results for any
given version of your software workflow. We will show you how to do so in the
next document.

<ThemedImage
  alt="You will need API Key and API URL to submit test results."
  sources={{
    light:
      "https://touca.io/docs/external/assets/touca-page-suite-empty.light.png",
    dark: "https://touca.io/docs/external/assets/touca-page-suite-empty.dark.png"
  }}
/>
